import 'dart:math';

import 'package:extended_nested_scroll_view/extended_nested_scroll_view.dart';
import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';
import 'package:flutter/widgets.dart';
import 'package:pull_to_refresh/pull_to_refresh.dart';

void main() {
  runApp(MyApp());
}

class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      home: Scaffold(
        appBar: AppBar(
          title: Text('Text Width Example'),
        ),
        body: MyTextWidget(),
      ),
    );
  }
}

class MyTextWidget extends StatelessWidget {
  final ScrollController _mainScrollController = ScrollController();
  ValueNotifier<double> offsetValueNotifier = ValueNotifier(0);
  RefreshController _refreshController = RefreshController();
  @override
  Widget build(BuildContext context) {
    return ExtendedNestedScrollView(
        physics: const BouncingScrollPhysics(),
        onlyOneScrollInBody: true,
        headerSliverBuilder: (BuildContext context, bool innerBoxIsScrolled){
          return [
            SliverToBoxAdapter(
              child: Container(
                color: Colors.green,
                width: 100,
                height: 100,
              ),
            ),
          ];
        }, body:


    // Container(color: Color.fromARGB(255, Random().nextInt(255), Random().nextInt(255), Random().nextInt(255)),width: 100,height: 100,margin: EdgeInsets.all(10),),


    ListView(
      physics: ClampingScrollPhysics(),
      children: List.generate(100, (index) => Container(color: Color.fromARGB(255, Random().nextInt(255), Random().nextInt(255), Random().nextInt(255)),width: 100,height: 100,margin: EdgeInsets.all(10),)),
    )


    );
  }

}
